package com.wsoft.bpm.config;

import com.wsoft.bpm.listener.BpmActivitiEventListener;
import org.activiti.engine.RuntimeService;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * @Author zhonglj
 * @Date 2024-10-08 17:44
 */
@Configuration
public class ActivitiEventListenerConfig {
    @Resource
    private BpmActivitiEventListener bpmActivitiEventListener;
    @Resource
    private RuntimeService runtimeService;

    @PostConstruct
    public void registerListeners() {
        // 注册事件监听器
        runtimeService.addEventListener(bpmActivitiEventListener);
    }
}
